
import React, { Fragment } from 'react';
import './NewLoveRemind.css';
const remindIcon = 'https://waterresource.haier.net/pre_terminal/electric_heater/assetsNew/5.0icon/LoveRemind.png';
const arrig = 'https://waterresource.haier.net/pre_terminal/electric_heater/assetsNew/5.0bg/more_black.png';

/*   ***关爱提醒组件***   */
class NewLoveRemind extends React.Component {
  constructor(props) {
    super(props);
    this.goDetail = this.goDetail.bind(this);
  }
  goDetail() {
    toast.info('去吧');
    this.props.history.push('./PeakValleyElectricityDel');
    const {mac, typeid, modelName } = this.props.DeviceState;
    this.props.DeviceState.cordovaUtil.upTraceModule.gioTrackWithVariable({
      eventId: 'MB33151', 
      variable: {
        deviceid: mac,
        typeid: typeid,
        model: modelName
      }
    }).then((result) => {
      console.log('gioTrackWithVariableresult', result);
    }, (err) => {
      console.log('gioTrackWithVariableerr', err);
    });
  }

  render() {
    return (
      <Fragment>
        <div>
          <div className={'popover-button'} onClick={this.goDetail.bind(this)}>
            <div className={'popoverTit-button'}>
              <div className={'popoverTit-button-t'}>
                <img src={remindIcon} alt="" />
                <div className={'popoverTit-button-extra'}>
                  <span>关爱提醒</span>
                  <p>监测用水异常，即刻提醒</p>
                </div>
              </div>
              <div className={'popoverTit-button-d'}>
                <img src={arrig} alt="" />
              </div>
            </div>
          </div>
        </div>
      </Fragment>
    );
  }
}

export default NewLoveRemind;
